package com.tchintech.pay.delegate;

import android.support.v4.app.Fragment;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.tchintech.pay.R;
import com.tchintech.pay.frame.view.AppDelegate;

import butterknife.Bind;
import butterknife.BindColor;

/**
 * Created by Administrator on 2017/7/5 0005.
 * //注册组件  view
 */

public class MainActivityDelegate extends AppDelegate {
    //钱包
    @Bind(R.id.main_iv_wallet)
    ImageView mainIvWallet;
    @Bind(R.id.main_tv_wallet)
    TextView mainTvWallet;
    @Bind(R.id.main_linear_wallet)
    LinearLayout mainLinearWallet;
    //分享
    @Bind(R.id.main_iv_share)
    ImageView mainIvShare;
    @Bind(R.id.main_tv_share)
    TextView mainTvShare;
    @Bind(R.id.main_linear_share)
    LinearLayout mainLinearShare;
    //我的
    @Bind(R.id.main_iv_my)
    ImageView mainIvMy;
    @Bind(R.id.main_tv_my)
    TextView mainTvMy;
    @Bind(R.id.main_linear_my)
    LinearLayout mainLinearMy;

    //颜色
    @BindColor(R.color.light_blue_bg)
    int main_txtColor_nol;
    @BindColor(R.color.gary_bg)
    int main_txt_sel;

    @Override
    public int getRootLayoutId() {
        return R.layout.activity_main;
    }


    public void clearSelection(int index) {
        //主界面
        mainIvWallet.setImageResource(R.drawable.tab_home_unselect);
        mainTvWallet.setTextColor(main_txt_sel);
        //分享
        mainIvShare.setImageResource(R.drawable.tab_share_unselect);
        mainTvShare.setTextColor(main_txt_sel);
        //我的
        mainIvMy.setImageResource(R.drawable.tab_account_unselect);
        mainTvMy.setTextColor(main_txt_sel);

        if (index == 0) {
            mainIvWallet.setImageResource(R.drawable.tab_home_select);
            mainTvWallet.setTextColor(main_txtColor_nol);
        }
        if (index == 1) {
            mainIvShare.setImageResource(R.drawable.tab_share_select);
            mainTvShare.setTextColor(main_txtColor_nol);
        }
        if (index == 2) {
            mainIvMy.setImageResource(R.drawable.tab_account_select);
            mainTvMy.setTextColor(main_txtColor_nol);
        }
    }

}
